// Copyright (c) 2008 Matthew Johnson
// Licensed under the MIT License (see license.txt)
package actionml.tracing {
	
	import flash.utils.getTimer;
	public dynamic class Trace {
		// Tracer method must be added and ClassMethods.getTracer must be updated when this list changes
		public static const TEST:String = "TEST";
		public static const ASSERT:String = "ASSERT";
		public static const TRACE:String = "TRACE";
		public static const INFO:String = "INFO";
		//public static const POSSIBLE_WARNING:String = "POSSIBLE_WARNING";
		public static const WARNING:String = "WARNING";
		//public static const LIKELY_ERROR:String = "LIKELY_ERROR";
		public static const ERROR:String = "ERROR";
		public static const CRITICAL:String = "CRITICAL";	
		
		private static const startTime = getTimer();

		public var className:String = "";
		public var method:String = "";
		public var category:String = "";
		public var context:String = ""; // xml, arg, result, ivar, interface, action, event
		public var message:String = "";
		public var year:String = new Date().getFullYear().toString();
		public var day:String = new Date().getDate()["toPaddedString"](2);
		public var month:String = (new Date().getMonth() + 1)["toPaddedString"](2);
		public var date:String = year + "-" + month + "-" + day;
		public var hour:String = new Date().getHours()["toPaddedString"](2);
		public var minute:String = new Date().getMinutes()["toPaddedString"](2);
		public var second:String = new Date().getSeconds()["toPaddedString"](2);
		public var millisecond:String = new Date().getMilliseconds()["toPaddedString"](3);
		public var time:String = hour + ":" + minute + ":" + second + ":" + millisecond;
		public var timer:String = (getTimer() - startTime)["toPaddedString"](6);
	}
}